from django.contrib import admin

from features.models import Feature
from features.models import Group
from features.models import Fitem
from features.models import Category
from features.models import Job
from features.models import Location
from features.models import Publisher
from features.models import Author
from features.models import Book

class LocationAdmin(admin.ModelAdmin):
    list_display = ("city", "state", "country")

class JobAdmin(admin.ModelAdmin):
    ordering = ["-pub_date"]
    list_display = ("job_title", "location", "pub_date")
    search_fields = ("job_title", "job_description")
    list_filter = ("location",)

class BookAdmin(admin.ModelAdmin):
    ordering = ["-publication_date"]
    list_display = ("title", "publisher","publication_date",)
    search_fields = ("title",)
    list_filter = ("publisher",)

admin.site.register(Feature)
admin.site.register(Group)
admin.site.register(Fitem)
admin.site.register(Category)
admin.site.register(Job,JobAdmin)
admin.site.register(Location,LocationAdmin)
admin.site.register(Publisher)
admin.site.register(Author)
admin.site.register(Book,BookAdmin)